<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>{$info['choose']}</h2>
    </div>
    <form action="{:U('modify')}" method="post"  class="form-horizontal">
        <div class="form-item">

            <div class="controls">
                <input type="text" id = 'ipt' class="text input-large" name="name" value="">
                <input type="hidden" class="text input-large" name="id" value="{$info['id']}">

            </div>
        </div>

        <div class="form-item">
            <h3 id = 'info'></h3>
            <button id = 'sub' class="btn submit-btn " id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Classify/index')}');

        // JS正则验证
        var res = '';
        $('#sub').click(function(){

            // 计算输入的字符串长度
            var num= $('#ipt').val().length;
            if (!num) {
                $('#info').html('分类名不能为空');

                setTimeout(function(){
                    $('#sub').removeAttr("disabled").attr('class' , 'btn submit-btn');
                },2000);

                return false;
            }
        });


    </script>
</block>
